import plotly.express as px
import pandas as pd


df = pd.read_excel(r"C:\Users\zizifreya\PycharmProjects\plotytest\data.xls")  # 将xlsx文件格式转化为dataframe
fig = px.bar(df,
             y="Language",
             x="count1",
             animation_frame="年月",
             orientation='h',
             range_x=[0, max("count1")+str(10)],
             color="count1")

fig.update_layout(width=1500,
                  height=800,
                  xaxis_showgrid=True,
                  yaxis_showgrid=True,
                  paper_bgcolor='rgba(0,0,0,0)',
                  plot_bgcolor='rgba(0,0,0,0)',
                  title_text=r'各类编程语言使用热度',
                  showlegend=False)
fig.update_xaxes(title_text='使用数量')
fig.update_yaxes(title_text='编程语言')
fig.show()
